feat: add Open-Box Deals Aggregator example#39
feat: add Open-Box Deals Aggregator example#39simantak-dabhade merged 3 commits intotinyfish-io:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing touches🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Added Demo
| if STATIC_DIR.exists(): | ||
| app.mount("/static", StaticFiles(directory=str(STATIC_DIR)), name="static") |
There was a problem hiding this comment.
why would the directory not exist if it's in the repo folder?
There was a problem hiding this comment.
ohh this was defensive coding for when running the app from different working directories during development. Since it's always in the repo now, I can simplify it to:
app.mount("/static", StaticFiles(directory=str(STATIC_DIR)), name="static")
should i remove the check?
|
|
||
|
|
||
| # ============================================================================= | ||
| # HELPER FUNCTIONS |
There was a problem hiding this comment.
these below look a bit fragile, but i see also above there's some json definition in the goal as well.
There was a problem hiding this comment.
yeah, that was a defense against malformed json response which was causing issues. and it handles edge cases quite well too.
| return sanitized.strip() | ||
|
|
||
|
|
||
| def validate_url(url: str) -> Optional[str]: |
There was a problem hiding this comment.
i don't think this is going to actually do anything in practice against someone with intent to break, we're going to a bunch of trusted sites in a hardcoded array anyways, right?
There was a problem hiding this comment.
yeah all sites are trusted platforms and hardcoded, just added it as precaution if mino returns malicious url somehow, but yeah its an overkill when data is from trusted platforms. should i remove it as well ?
A warehouse receipt-themed deal finder that uses TinyFish Agent API to scrape Amazon, Best Buy, Target, Walmart, and 4 other retailers simultaneously. Features live browser previews, automatic savings calculations, and sorts results by best discount.